import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/shop/goods',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/shop/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/shop/pv',
    method: 'get',
    params: {
      pv
    }
  })
}

export function createProduct(data) {
  return request({
    url: '/shop/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/shop/update',
    method: 'post',
    data
  })
}
/**
 * 创建商城栏目分类
 * @param {*} data
 */
export function createCategory(data) {
  return request({
    url: '/shop/category/create',
    method: 'post',
    data
  })
}
